<template>
    <ul class="list-group">
        <li class="list-group-item" v-for="item in list" :key="item.id">{{ item.title }}</li>
    </ul>
</template>

<script setup>
import axios from 'axios';
import { ref, watchEffect } from 'vue';

const list = ref([])

const props = defineProps(['tcurrentPage'])
console.log(props);
// props.fhandler()

watchEffect(() => {
    axios.get('https://cnodejs.org/api/v1/topics', {
        params: { limit: 6, page: props.tcurrentPage + 1 }
    }).then(res => {
        console.log(props.tcurrentPage);
        console.log('res.data.data=>', res.data.data);
        list.value = res.data.data
    })
})

</script>

<style lang="scss" scoped></style>